// CSS Reset (based on https://piccalil.li/blog/a-more-modern-css-reset/)
*,
*::before,
*::after {
  box-sizing: border-box;
}

* {
  margin: 0;
}

body {
  min-height: 100vh;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

img,
picture,
video,
canvas,
svg {
  display: block;
  max-width: 100%;
}

input,
button,
textarea,
select {
  font: inherit;
}

ul[class],
ol[class] {
  list-style: none;
}

h1,
h2,
h3,
h4 {
  text-wrap: balance;
}

p,
h1,
h2,
h3,
h4,
h5,
h6 {
  overflow-wrap: break-word;
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

// Font faces
@font-face {
  font-family: "IosevkaFtl";
  src: url("/fonts/IosevkaFtl-Regular.ttf") format("truetype");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "IosevkaFtl";
  src: url("/fonts/IosevkaFtl-Bold.ttf") format("truetype");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "PublicSans";
  src: url("/fonts/PublicSans-Regular.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "PublicSans";
  src: url("/fonts/PublicSans-Bold.woff2") format("woff2");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "PublicSans";
  src: url("/fonts/PublicSans-Italic.woff2") format("woff2");
  font-weight: 400;
  font-style: italic;
  font-display: swap;
}

@font-face {
  font-family: "PublicSans";
  src: url("/fonts/PublicSans-Black.woff2") format("woff2");
  font-weight: 900;
  font-style: normal;
  font-display: swap;
}

// CSS Custom Properties
:root {
  --bg-color: #fff;
  --text-color: #1a1a2e;
  --text-muted: #4a5568;
  --code-bg: #f8f9fc;
  --border-color: #e2e6f0;
  --link-color: #3b82f6;   // blue-500
  --link-hover: #60a5fa;   // blue-400
  --accent-color: #6366f1; // indigo-500

  --font-sans: "PublicSans", system-ui, -apple-system, sans-serif;
  --font-mono: "IosevkaFtl", ui-monospace, "Cascadia Code", "Source Code Pro", Menlo, Consolas, monospace;

  --content-width: min(1200px, 100%);
  --spacing-sm: 0.5rem;
  --spacing-md: 1rem;
  --spacing-lg: 2rem;
  --spacing-xl: 3rem;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg-color: #0b1020;
    --text-color: #e8ecf7;
    --text-muted: #9ba3be;
    --code-bg: #11182b;
    --border-color: #1c2336;
    --link-color: #93c5fd;   // blue-300
    --link-hover: #bfdbfe;   // blue-200
    --accent-color: #a5b4fc; // indigo-200
  }
}

// Site navigation
.site-nav {
  display: flex;
  align-items: center;
  padding: var(--spacing-md) var(--spacing-lg);
  border-bottom: 1px solid var(--border-color);
  background-color: rgba(255, 255, 255, 0.8);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  position: sticky;
  top: 0;
  z-index: 100;

  @media (prefers-color-scheme: dark) {
    background-color: rgba(15, 15, 26, 0.8);
  }
}

.site-nav-brand {
  display: flex;
  align-items: center;
  gap: var(--spacing-sm);
  font-weight: 900;
  font-size: 1.5rem;
  color: var(--text-color);

  &:hover {
    color: var(--text-color);
  }
}

.site-nav-logo {
  width: 2rem;
  height: 2rem;
}

.site-nav-links {
  display: flex;
  gap: var(--spacing-lg);
  flex: 1;
  justify-content: center;

  a {
    color: var(--text-muted);
    font-size: 0.95rem;

    &:hover {
      color: var(--link-color);
    }
  }
}

.site-nav-github {
  color: var(--text-muted);
  display: flex;
  align-items: center;

  &:hover {
    color: var(--text-color);
  }
}

// Pagefind search overrides
.site-nav-search {
  position: relative;
  margin-right: var(--spacing-md);

  .pagefind-ui {
    --pagefind-ui-scale: 0.7;
    --pagefind-ui-primary: var(--accent-color);
    --pagefind-ui-text: var(--text-color);
    --pagefind-ui-background: var(--bg-color);
    --pagefind-ui-border: var(--border-color);
    --pagefind-ui-border-width: 1px;
    --pagefind-ui-border-radius: 4px;
    --pagefind-ui-font: var(--font-sans);
  }

  // The form wrapper
  .pagefind-ui__form {
    width: 200px;
  }

  // Results container - position it as dropdown
  .pagefind-ui__drawer {
    position: absolute !important;
    right: 0 !important;
    left: auto !important;
    top: 100% !important;
    width: 420px !important;
    max-width: calc(100vw - 2rem) !important;
    max-height: 80vh !important;
    overflow-y: auto !important;
    background: var(--bg-color) !important;
    border: 1px solid var(--border-color) !important;
    border-radius: 8px !important;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4) !important;
    margin-top: 0.5rem !important;
    z-index: 1000 !important;
    padding: 0 1.5rem !important;
  }

  // Hide the "X results" message or make it smaller
  .pagefind-ui__message {
    font-size: 0.8rem;
    padding: 0.5rem;
    color: var(--text-muted);
  }

  .pagefind-ui__search-input {
      font-weight: 400 !important;
  }

  // Individual results
  .pagefind-ui__result {
    padding: 0.5rem !important;
    border-bottom: 1px solid var(--border-color);

    &:last-child {
      border-bottom: none;
    }
  }

  .pagefind-ui__result-inner {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
  }

  .pagefind-ui__result-title {
    font-size: 0.9rem !important;
    font-weight: 600;

    .pagefind-ui__result-link {
      color: var(--text-color);

      &:hover {
        color: var(--link-color);
      }
    }
  }

  .pagefind-ui__result-excerpt {
    font-size: 0.8rem !important;
    line-height: 1.4;
    color: var(--text-muted);

    mark {
      background: var(--accent-color);
      color: #fff;
      padding: 0.1em 0.25em;
      border-radius: 2px;
      font-weight: 500;
    }
  }

  // Sub-results (nested headings)
  .pagefind-ui__result-nested {
    margin-top: 0.25rem;
    margin-left: 0.75rem;
    padding-left: 0.75rem;
    font-size: 0.85rem;

    .pagefind-ui__result-link {
      color: var(--text-muted);
      font-weight: 500;

      &:hover {
        color: var(--link-color);
      }
    }
  }

  // Hide images in results
  .pagefind-ui__result-thumb {
    display: none !important;
  }

  // Hide tag/filter stuff we don't use
  .pagefind-ui__result-tag {
    display: none;
  }
}

// Base styles
html {
  font-size: 16px;
}

body {
  font-family: var(--font-sans);
  background-color: var(--bg-color);
  background-image:
    radial-gradient(800px at 20% 20%, rgba(99, 102, 241, 0.08), transparent 60%),
    radial-gradient(900px at 80% 0%, rgba(59, 130, 246, 0.10), transparent 55%);
  color: var(--text-color);
  line-height: 1.6;
}

.container {
  width: var(--content-width);
  margin: 0 auto;
  padding: var(--spacing-lg);
}

// Typography
h1,
h2,
h3,
h4,
h5,
h6 {
  scroll-margin-top: 6rem; // Account for sticky nav when jumping to anchors
}

h1 {
  font-size: 2rem;
  font-weight: 900;
  margin-bottom: var(--spacing-lg);
  line-height: 1.2;

  @media (min-width: 768px) {
    font-size: 2.5rem;
  }
}

h2 {
  font-size: 1.75rem;
  font-weight: 700;
  margin-top: var(--spacing-md);
  margin-bottom: var(--spacing-sm);

  a {
    color: inherit;
  }
}

h3 {
  font-size: 1.1rem;
  font-weight: 600;
  margin-top: var(--spacing-lg);
  margin-bottom: var(--spacing-sm);

  a {
    color: inherit;
  }
}

h4 {
  font-family: var(--font-mono);
  font-size: 0.9rem;
  font-weight: 400;
  margin-top: var(--spacing-md);
  margin-bottom: var(--spacing-sm);

  a {
    color: inherit;
  }
}

p {
  margin-bottom: var(--spacing-md);
}

a {
  color: var(--link-color);
  text-decoration: none;

  &:hover {
    color: var(--link-hover);
  }
}

// Lists
ul,
ol {
  margin-bottom: var(--spacing-md);
  padding-left: 1.5rem;
}

li {
  margin-bottom: 0.25rem;
  line-height: 1.5;

  > ul,
  > ol {
    margin-top: 0.25rem;
    margin-bottom: 0.25rem;
  }
}

// Tighter lists in specific contexts
.sidebar ul,
.sidebar ol,
.toc ul,
.toc ol,
.page-toc ul,
.page-toc ol,
.breadcrumbs ol,
.footer-section ul {
  margin-bottom: 0;
  padding-left: 0;
}

.sidebar li,
.toc li,
.page-toc li,
.footer-section li {
  margin-bottom: 0.25rem;
}

// Code
code {
  font-family: var(--font-mono);
  background-color: var(--code-bg);
  padding: 0.1em 0.3em;
  border-radius: 3px;
}

pre {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  line-height: 1.4;
  background-color: var(--code-bg);
  border: 1px solid var(--border-color);
  padding: var(--spacing-md);
  border-radius: 6px;
  overflow-x: auto;
  margin-bottom: var(--spacing-md);

  code {
    background: none;
    padding: 0;
  }
}

// Blockquotes
blockquote {
  border-left: 4px solid var(--accent-color);
  margin: var(--spacing-md) 0;
  padding: var(--spacing-sm) var(--spacing-md);
  background-color: var(--code-bg);

  p:last-child {
    margin-bottom: 0;
  }
}

// Tables
table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: var(--spacing-md);
  font-size: 0.9rem;
}

th,
td {
  padding: 0.4rem 0.75rem;
  border: 1px solid var(--border-color);
  text-align: left;
  vertical-align: top;
}

th {
  background-color: transparent;
  font-weight: 400;
  color: var(--text-muted);
  font-size: 0.9rem;
}

// Remove redundant background from code blocks inside table cells
td pre {
  background: transparent;
  margin: 0;
  padding: 0.25rem 0;
}

// Horizontal rule
hr {
  border: none;
  border-top: 1px solid var(--border-color);
  margin: var(--spacing-xl) 0;
}

// Page layout with TOC
.page-layout {
  display: flex;
  gap: var(--spacing-xl);
  max-width: 1200px;
  margin: 0 auto;
}

// Table of Contents
.toc {
  display: none;
  flex-shrink: 0;
  width: 16em;
  position: sticky;
  top: 6.8rem;
  align-self: flex-start;
  max-height: calc(100vh - 6rem);
  overflow-y: auto;

  @media (min-width: 920px) {
    display: block;
  }

  h2 {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin: 0 0 var(--spacing-md) 0;
    padding: 0;
    border: none;
    color: var(--text-muted);
    font-weight: 700;
  }

  ul {
    list-style: none;
    padding: 0;
    margin: 0;

    ul {
      padding-left: var(--spacing-md);
      margin-top: 0.25rem;
    }
  }

  li {
    margin-bottom: 0.35rem;
  }

  a {
    font-size: 0.875rem;
    color: var(--text-color);
    display: block;
    padding: 0.15rem 0;
    opacity: 0.75;
    transition: opacity 0.15s ease;

    &:hover {
      opacity: 1;
      color: var(--link-color);
    }
  }
}

// Content area
.content {
  max-width: var(--content-width);
  flex: 1;
  min-width: 0;

  > *:first-child {
    margin-top: 0;
  }
}

// Page title (for subpages)
.page-title {
  margin-bottom: var(--spacing-lg);
}

// Syntax highlighting (CSS classes mode)
// Light theme colors
pre code {
  // Keywords, control flow
  .z-keyword { color: #d73a49; }
  .z-storage { color: #d73a49; }

  // Types
  .z-entity.z-name.z-type,
  .z-entity.z-name.z-struct,
  .z-entity.z-name.z-enum,
  .z-entity.z-name.z-trait,
  .z-support.z-type { color: #6f42c1; }

  // Functions
  .z-entity.z-name.z-function,
  .z-meta.z-function-call .z-variable.z-function { color: #6f42c1; }

  // Strings
  .z-string { color: #032f62; }

  // Numbers
  .z-constant.z-numeric { color: #005cc5; }

  // Comments
  .z-comment { color: #6a737d; font-style: italic; }

  // Variables, parameters
  .z-variable { color: #24292e; }
  .z-variable.z-parameter { color: #e36209; }
  .z-variable.z-other.z-member { color: #005cc5; }

  // Punctuation
  .z-punctuation { color: #24292e; }

  // Macros/attributes
  .z-meta.z-annotation,
  .z-variable.z-annotation { color: #22863a; }

  // Operators
  .z-keyword.z-operator { color: #d73a49; }

  // Constants
  .z-constant.z-language { color: #005cc5; }

  // Lifetimes
  .z-storage.z-modifier.z-lifetime { color: #e36209; }
}

// Dark theme colors
@media (prefers-color-scheme: dark) {
  pre code {
    // Keywords, control flow
    .z-keyword { color: #ff7b72; }
    .z-storage { color: #ff7b72; }

    // Types
    .z-entity.z-name.z-type,
    .z-entity.z-name.z-struct,
    .z-entity.z-name.z-enum,
    .z-entity.z-name.z-trait,
    .z-support.z-type { color: #d2a8ff; }

    // Functions
    .z-entity.z-name.z-function,
    .z-meta.z-function-call .z-variable.z-function { color: #d2a8ff; }

    // Strings
    .z-string { color: #a5d6ff; }

    // Numbers
    .z-constant.z-numeric { color: #79c0ff; }

    // Comments
    .z-comment { color: #8b949e; font-style: italic; }

    // Variables, parameters
    .z-variable { color: #c9d1d9; }
    .z-variable.z-parameter { color: #ffa657; }
    .z-variable.z-other.z-member { color: #79c0ff; }

    // Punctuation
    .z-punctuation { color: #c9d1d9; }

    // Macros/attributes
    .z-meta.z-annotation,
    .z-variable.z-annotation { color: #7ee787; }

    // Operators
    .z-keyword.z-operator { color: #ff7b72; }

    // Constants
    .z-constant.z-language { color: #79c0ff; }

    // Lifetimes
    .z-storage.z-modifier.z-lifetime { color: #ffa657; }
  }
}

// Terminal/code block styling for the fancy outputs
pre.term {
  background-color: #1a1a1a;
  color: #e0e0e0;
  padding: var(--spacing-md);
  border-radius: 6px;
  overflow-x: auto;

  .b { font-weight: bold; }
  .l { opacity: 0.7; }
  .fg-cyn { color: #56b6c2; }
  .fg-mag { color: #c678dd; }
  .fg-grn { color: #98c379; }
  .fg-red { color: #e06c75; }
  .fg-lred { color: #be5046; }
  .fg-ansi1 { color: #e06c75; }
  .fg-ansi2 { color: #98c379; }
  .fg-ansi4 { color: #61afef; }
}

// Showcase styling
.showcase-container {
  .showcase {
    // Scenario sections
    .scenario {
      margin-bottom: var(--spacing-xl);
      padding-bottom: var(--spacing-lg);
      border-bottom: 1px solid var(--border-color);

      &:last-child {
        border-bottom: none;
      }
    }

    h3 {
      font-size: 1.25rem;
      margin-top: 0;
      margin-bottom: var(--spacing-sm);
    }

    .description {
      color: var(--text-muted);
      margin-bottom: var(--spacing-md);
    }

    h4 {
      font-size: 0.8rem;
      text-transform: uppercase;
      letter-spacing: 0.05em;
      color: var(--text-muted);
      margin-top: var(--spacing-md);
      margin-bottom: var(--spacing-sm);
    }

    pre {
      font-size: 0.95rem;
      padding: 0.75rem 1rem;
      margin-bottom: 0;
    }

    // Input/target/success sections
    .input,
    .target-type,
    .success,
    .error {
      margin-bottom: var(--spacing-sm);
    }

    // Success and error blocks need dark background (they use ANSI colors)
    .success pre,
    .error pre {
      background-color: #1a1b26;
      color: #c0caf5;
      border-radius: 6px;
    }

  }
}

// Format navigation for showcases
.format-nav {
  display: flex;
  gap: var(--spacing-sm);
  margin-bottom: var(--spacing-lg);
  padding-bottom: var(--spacing-md);
  border-bottom: 1px solid var(--border-color);
  flex-wrap: wrap;

  a {
    padding: 0.4rem 0.8rem;
    border-radius: 4px;
    background-color: var(--code-bg);
    color: var(--text-color);
    font-size: 0.9rem;
    transition: background-color 0.15s ease;

    &:hover {
      background-color: var(--border-color);
      color: var(--text-color);
    }

    &.active {
      background-color: var(--accent-color);
      color: #fff;
    }
  }
}

// Docs layout with sidebar
.docs-layout {
  display: flex;
  min-height: calc(100vh - 60px); // Account for nav height
  max-width: 1400px;
  margin: 0 auto;
}

// Left sidebar
.sidebar {
  width: 260px;
  flex-shrink: 0;
  border-right: 1px solid var(--border-color);
  background: var(--bg-color);
  position: sticky;
  top: 60px; // Below nav
  height: calc(100vh - 60px);
  overflow-y: auto;
  padding: var(--spacing-md) 0;

  nav {
    padding: var(--spacing-sm) var(--spacing-md) var(--spacing-md);
  }

  .sidebar-header {
    font-weight: 700;
    font-size: 1.1rem;
    margin-bottom: var(--spacing-sm);
    padding: 0 var(--spacing-sm);

    a {
      color: var(--text-color);

      &:hover {
        color: var(--link-color);
      }
    }
  }

  ul {
    list-style: none;
    padding: 0;
    margin: 0;

    ul {
      padding-left: var(--spacing-md);
      margin-top: 0.25rem;
    }
  }

  li {
    margin-bottom: 0.25rem;
  }

  a {
    display: block;
    padding: 0.35rem var(--spacing-sm);
    color: var(--text-muted);
    font-size: 0.9rem;
    border-radius: 4px;
    transition: background-color 0.15s ease, color 0.15s ease;

    &:hover {
      color: var(--text-color);
      background: var(--code-bg);
    }

    &.active {
      color: var(--link-color);
      background: var(--code-bg);
      font-weight: 500;
    }
  }

  .has-children > a {
    font-weight: 500;
  }
}

// Main docs content area
.docs-content {
  flex: 1;
  min-width: 0;
  display: flex;
  gap: var(--spacing-xl);
  padding: var(--spacing-lg) var(--spacing-xl);

  article {
    flex: 1;
    min-width: 0;
    max-width: 800px;
  }
}

// Right-side page TOC
.page-toc {
  width: 200px;
  flex-shrink: 0;
  position: sticky;
  top: calc(60px + var(--spacing-lg));
  align-self: flex-start;
  max-height: calc(100vh - 100px);
  overflow-y: auto;
  display: none;

  @media (min-width: 1200px) {
    display: block;
  }

  h2 {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    margin: 0 0 var(--spacing-sm) 0;
    font-weight: 600;
  }

  ul {
    list-style: none;
    padding: 0;
    margin: 0;

    ul {
      padding-left: var(--spacing-md);
    }
  }

  li {
    margin-bottom: 0.25rem;
  }

  a {
    font-size: 0.8rem;
    color: var(--text-muted);

    &:hover {
      color: var(--link-color);
    }
  }
}

// Top nav active state
.site-nav-links a.active {
  color: var(--link-color);
  font-weight: 600;
}

// Home page content
.home-content {
  max-width: 900px;
  margin: 0 auto;
  padding: var(--spacing-xl) var(--spacing-lg);
}

// Responsive sidebar
@media (max-width: 900px) {
  .docs-layout {
    flex-direction: column;
  }

  .sidebar {
    width: 100%;
    height: auto;
    position: static;
    border-right: none;
    border-bottom: 1px solid var(--border-color);
    padding: var(--spacing-md);

    nav {
      padding: 0;
    }

    ul ul {
      display: none; // Collapse nested items on mobile
    }
  }

  .docs-content {
    padding: var(--spacing-md);
  }
}

// Guide cards on homepage
.guide-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: var(--spacing-lg);
  margin: var(--spacing-lg) 0;
}

.guide-card {
  display: block;
  background: var(--code-bg);
  border-radius: 10px;
  padding: var(--spacing-lg);
  border: 1px solid var(--border-color);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.25);
  transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
  color: var(--text-color);
  text-decoration: none;

  .guide-card__icon {
    width: 40px;
    height: 40px;
    margin-bottom: var(--spacing-sm);

    img {
      width: 100%;
      height: 100%;
      object-fit: contain;
      filter: invert(0.12) sepia(0.25) saturate(2) hue-rotate(190deg);

      @media (prefers-color-scheme: dark) {
        filter: invert(0.82) sepia(0.05) saturate(1) hue-rotate(180deg);
      }
    }
  }

  h3 {
    font-size: 1.25rem;
    margin: 0 0 var(--spacing-sm) 0;

    a {
      color: inherit;
    }
  }

  .tagline {
    color: var(--text-muted);
    font-style: italic;
    margin: 0 0 var(--spacing-sm) 0;
  }

  .description {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin: 0;
  }

  &:hover {
    transform: translateY(-4px);
    border-color: var(--link-color);
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.35);
  }
}

// Format cards (Learn page)
.format-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: var(--spacing-md);
  margin: var(--spacing-md) 0 var(--spacing-lg);
}

.format-card {
  display: block;
  background: var(--code-bg);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  padding: var(--spacing-md);
  text-decoration: none;
  color: var(--text-color);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
  transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;

  &:hover {
    transform: translateY(-3px);
    border-color: var(--link-color);
    box-shadow: 0 14px 32px rgba(0, 0, 0, 0.28);
  }

  .format-card__title {
    font-weight: 800;
    letter-spacing: 0.01em;
    margin-bottom: 0.35rem;
  }

  .format-card__crate {
    display: inline-block;
    font-family: var(--font-mono);
    font-size: 0.9rem;
    padding: 0.2rem 0.5rem;
    border-radius: 6px;
    background: rgba(99, 102, 241, 0.12);
    border: 1px solid rgba(99, 102, 241, 0.25);
    color: var(--link-color);
    margin-bottom: 0.4rem;
  }

  .format-card__desc {
    color: var(--text-muted);
    margin: 0;
    font-size: 0.95rem;
    line-height: 1.4;
  }
}

// Breadcrumbs
.breadcrumbs {
  margin-bottom: var(--spacing-md);

  ol {
    display: flex;
    flex-wrap: wrap;
    list-style: none;
    padding: 0;
    margin: 0;
    font-size: 0.85rem;
  }

  li {
    margin: 0;
    display: flex;
    align-items: center;

    &:not(:last-child)::after {
      content: "/";
      margin: 0 0.5rem;
      color: var(--text-muted);
      opacity: 0.5;
    }

    &:last-child {
      color: var(--text-muted);
    }
  }

  a {
    color: var(--text-muted);

    &:hover {
      color: var(--link-color);
    }
  }
}

// Site footer
.site-footer {
  border-top: 1px solid var(--border-color);
  background: var(--code-bg);
  padding: var(--spacing-xl) var(--spacing-lg);
  margin-top: var(--spacing-xl);
}

.footer-content {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  gap: var(--spacing-xl);
  justify-content: space-between;
}

.footer-section {
  h4 {
    font-size: 0.85rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    margin: 0 0 var(--spacing-sm) 0;
  }

  ul {
    list-style: none;
    padding: 0;
    margin: 0;
  }

  li {
    margin-bottom: 0.35rem;
  }

  a {
    color: var(--text-color);
    font-size: 0.9rem;

    &:hover {
      color: var(--link-color);
    }
  }

  &.footer-meta {
    p {
      color: var(--text-muted);
      font-size: 0.85rem;
      margin: 0;

      &.muted {
        opacity: 0.75;
      }
    }
  }
}

// Responsive
@media (max-width: 768px) {
  .container {
    padding: var(--spacing-md);
  }

  h2 {
    font-size: 1.5rem;
  }

  pre {
    font-size: 0.8rem;
  }

  table {
    display: block;
    overflow-x: auto;
  }

  .footer-content {
    flex-direction: column;
    gap: var(--spacing-lg);
  }
}
